﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace PServiceBus.Core.Interface {
    /// <summary>
    /// Base class for implement components that interact with data stores
    /// </summary>
    public interface IComponent {
        /// <summary>
        /// Startup code for component
        /// </summary>
        void Init();
        /// <summary>
        /// How many item to process on each execution
        /// </summary>
        int BatchSize { get; set; }
        /// <summary>
        /// Executes the current component
        /// </summary>
        void Execute();
        /// <summary>
        /// Clean up code for component
        /// </summary>
        void Close();
        /// <summary>
        /// Called when System shutdown. Implement to persist before system shutdown
        /// </summary>
        void SaveState();
    }
}
